//==============================================================================================================================================================
// Author(s): Roman Khmelichek Wei Jiang
//
// Defines standard properties that are used by config file readers.
// Corresponding with the on disk file: irtk.conf
//==============================================================================================================================================================

#ifndef CONFIG_FILE_PROPERTIES_H_
#define CONFIG_FILE_PROPERTIES_H_

namespace config_properties {

/**************************************************************************************************************************************************************
 * Indexing Parameters
 *
 **************************************************************************************************************************************************************/
// Document collection format.
static const char kDocumentCollectionFormat[] = "document_collection_format";

// The initial buffer size to use for uncompressing document collection files.
static const char kDocumentCollectionBufferSize[] = "document_collection_buffer_size";

// Size of the hash table used for posting accumulation.
static const char kHashTableSize[] = "hash_table_size";

// Size of the memory pool for posting accumulation.
static const char kMemoryPoolSize[] = "memory_pool_size";

// Size of each memory pool block. Should be kept small to make the most use of memory. The smaller the size, the less memory we waste for very small lists,
// but the more overall pointer overhead we have since we have to store a pointer for each block allocated in the memory pool.
static const char kMemoryPoolBlockSize[] = "memory_pool_block_size";

// Controls whether positions will be indexed.
static const char kIncludePositions[] = "include_positions";

// Controls whether contexts will be indexed.
static const char kIncludeContexts[] = "include_contexts";

// The coding policy to be used for compressing the docIDs.
static const char kIndexingDocIdCoding[] = "indexing_doc_id_coding";

// The coding policy to be used for compressing the frequencies.
static const char kIndexingFrequencyCoding[] = "indexing_frequency_coding";

// The coding policy to be used for compressing the positions, if they are to be included.
static const char kIndexingPositionCoding[] = "indexing_position_coding";

// The coding policy to be used for compressing the block header.
static const char kIndexingBlockHeaderCoding[] = "indexing_block_header_coding";

/**************************************************************************************************************************************************************
 * Merging Parameters
 *
 **************************************************************************************************************************************************************/
// Controls whether files that have already been merged should be deleted (Saves considerable disk space).
static const char kDeleteMergedFiles[] = "delete_merged_files";

// The coding policy to be used for compressing the docIDs.
static const char kMergingDocIdCoding[] = "merging_doc_id_coding";

// The coding policy to be used for compressing the frequencies.
static const char kMergingFrequencyCoding[] = "merging_frequency_coding";

// The coding policy to be used for compressing the positions, if they were included in the index.
static const char kMergingPositionCoding[] = "merging_position_coding";

// The coding policy to be used for compressing the block header.
static const char kMergingBlockHeaderCoding[] = "merging_block_header_coding";

/**************************************************************************************************************************************************************
 * Layering Parameters
 *
 **************************************************************************************************************************************************************/
// Controls whether the layers are overlapping or not. If they are, successive layers will always be a superset of the previous layers.
static const char kOverlappingLayers[] = "overlapping_layers";

// This is subject to 'MAX_LIST_LAYERS' defined in 'index_layout_parameters.h'. It controls the (max) number of layers we should have per list.
static const char kNumLayers[] = "num_layers";

// Controls the layering strategy. Valid values include 'percentage-lower-bounded', 'percentage-lower-upper-bounded', and 'exponentially-increasing'.
static const char kLayeringStrategy[] = "layering_strategy";

/**************************************************************************************************************************************************************
 * Querying Parameters
 *
 **************************************************************************************************************************************************************/
// Sets whether the whole index will be read into main memory. If true, the 'block_cache_size' and 'read_ahead_blocks' options are ignored.
static const char kMemoryResidentIndex[] = "memory_resident_index";

// Sets whether the whole index will be memory mapped into the process address space. If true, the 'block_cache_size' and 'read_ahead_blocks' options are ignored.
// This option has precedence over the 'memory_resident_index' option when both are true.
static const char kMemoryMappedIndex[] = "memory_mapped_index";

// The number of blocks to cache in memory.
static const char kBlockCacheSize[] = "block_cache_size";

// The number of blocks to read ahead from a list into the cache.
static const char kReadAheadBlocks[] = "read_ahead_blocks";

// Size of the hash table used for the lexicon.
static const char kLexiconSize[] = "lexicon_size";

// The maximum number of results returned by the query processor.
static const char kMaxNumberResults[] = "max_number_results";

// Controls whether positions will be utilized if the index was built with positions.
static const char kUsePositions[] = "use_positions";

// Controls whether an in-memory block level index will be built on startup and used to skip fetching/decoding unnecessary blocks.
static const char kUseBlockLevelIndex[] = "use_block_level_index";

// Controls from where batch query input will come from.
// Valid values are either 'stdin'/'cin' or the path to the batch query file.
static const char kBatchQueryInputFile[] = "batch_query_input_file";

// Controls from where batch request input will come from.
// Valid values are either 'stdin'/'cin' or the path to the batch request file.
static const char kBatchRequestInputFile[] = "batch_request_input_file";

/**************************************************************************************************************************************************************
 * Index DocID Remapping Parameters
 *
 **************************************************************************************************************************************************************/
// Controls whether intermediate remapped index files should be deleted (Saves considerable disk space).
static const char kDeleteIntermediateRemappedFiles[] = "delete_intermediate_remapped_files";

// Size of the buffer (in MiB) to hold index entries.
static const char kIndexEntryBufferSize[] = "index_entry_buffer_size";

// Size of the positions pool buffer (in MiB). Only allocated if the index to be remapped holds positions.
static const char kPositionsPoolBufferSize[] = "positions_pool_buffer_size";

/**************************************************************************************************************************************************************
 * Distributed Query Processing Parameters
 *
 **************************************************************************************************************************************************************/
// Slave Machines Sockets Mapping Table
// Valid values is the path to the Slave Machines Sockets Mapping Table file.
static const char kSlaveMachineSocketsMappingFile[] = "slave_machine_sockets_mapping_file";


/**************************************************************************************************************************************************************
 * Feature Generation Parameters
 *
 **************************************************************************************************************************************************************/


// the index for spam rank
static const char kSpamRankDictFile[] = "spam_rank_dict_file";

// the spam rank file
static const char kSpamRankFile[] = "spam_rank_file";

// the file for top 1M popular sites
static const char kPopularSiteFile[] = "popular_site_file";

// document level feature output file path
static const char kDocumentFeatureOutputFilePath[] = "document_feature_output_file_path";

// partial term level feature output file path
static const char kTermFeaturePartialOutputFilePath[] = "term_feature_partial_output_file_path";

// IDF score and related output file path
static const char kIDFOutputFilePath[] = "IDF_output_file_path";

// the complete term level feature output file path
static const char kTermFeatureCompleteOutputFilePath[] = "term_feature_complete_output_file_path";

// the priority warc document IDs list file path
static const char kPriorityWarcDocumentsIDsListFilePath[] = "priority_warc_documentIDs_list_file_path";

// the number of documents we want to collect(just approximate, cause in the program, it will stop at roughly around the number specifc)
static const char kMinNumberOfDocumentsNeedToCollect[] = "minimun_number_of_documents_need_to_collect";

// the individual term BM25 score list output path
static const char kIndividualTermBM25ScoreListOutputPath[] = "individual_term_BM25_score_list_output_path";

// the file for term BM25 score list
static const char kTermForBM25ScoreList[] = "term_for_BM25_score_list";

// query term docID pair BM25 score output file
static const char kQueryTermDocIDPairPositionsOutputFile[] = "query_term_docID_pair_positions_output_file";

// queryID term docID pair input file
static const char kQueryIDTermDocIDPairInputFile[] = "queryID_term_docID_pair_input_file";

// docID WARCTRECID 1M pair(currently existed) file for the current 1M documents.
static const char kDocIDWARCTRECID1MPairFile[] = "docID_WARCTRECID_1M_pair_file";

// clueweb docID WARCTRECID compressedFilePath beginningByte endingByte folder path
static const char kDocSpecifcPositionFolderPath[] = "doc_specific_position_folder_path";

// aux clueweb docID WARCTRECID compressedFilePath beginningByte endingByte folder path
static const char kAuxDocSpecifcPositionFolderFileList[] = "aux_doc_specific_position_folder_file_list";

// clueweb compressed file ID absolute path pair.
static const char kCompressedFileIDFilePath[] = "compressed_file_id_file_path";

// aux clueweb compressed file ID absolute path pair.
static const char kAuxCompressedFileIDFileList[] = "aux_compressed_file_id_file_list";

// aux file for pruning.
static const char kAuxFileForPruning[] = "aux_file_for_pruning";

// freq of query terms in collection.
static const char kFreqOfQueryTermsInCollection[] = "freq_of_query_terms_in_collection";

// new score intermediate file for pruning for Vineet and Juan use.
static const char kNewScoreIntermediateFileForPruning[] = "new_score_intermediate_file_for_pruning";

// learning to prune intermediate training output file.
static const char kLearningToPruneIntermediateTrainingOutputFile[] = "learning_to_prune_intermediate_training_output_file";

static const char kSystemLogFileName[] = "system_log_file_name";
static const char kSystemLogFileNameCompletelyPrunedTerms[] = "system_log_file_name_completely_pruned_terms";

static const char kUniversalImportanceThresholdSocreOfPosting[] = "universal_importance_threshold_socre_of_posting";

static const char kUniversalComputationMethod[] = "universal_computation_method";

static const char kQueryTermThresholdsKeptBasedOnPercentage[] = "query_term_thresholds_kept_based_on_percentage";

static const char kIndexPositionOfCorrespondingThresholdToUse[] = "index_position_of_corresponding_threshold_to_use";

static const char kQueryViewQueryInputFileName[] = "query_view_query_input_file_name";

// I just directly add this variable, maybe the adding position is not right
static const char kPopularTermPairListFileName[] = "popular_term_pair_list_file_name";

static const char kPopularTermPairNoDirectionProbabilityFileName[] = "popular_term_pair_no_direction_probability_file_name";

static const char kTermPairEdgeFreqThreshold[] = "term_pair_edge_freq_threshold";

static const char kGov2DocumentNeededToBeFurtherProcessFileName[] = "gov2_document_needed_to_be_further_process_file_name";

// These output files are all controlled by the class called EdgeCollectionController
static const char kGov2DocumentWithTheirConnectedEdgesFileName[] = "gov2_document_with_their_connected_edges_file_name";
static const char kGov2DocumentWithTheirForwardIndex[] = "gov2_document_with_their_forward_index";
static const char kGov2DocumentWithTheirCompletedPostingSet[] = "gov2_document_with_their_completed_posting_set";
static const char kGov2DocumentWithTheirXdocValue[] = "gov2_document_with_their_Xdoc_value";
static const char kGov2DocumentWithTheirNumOfPostingsRecordedAndTheDistinctSetOfTerms[] = "gov2_document_with_their_num_of_postings_recorded_and_the_distinct_set_of_terms";

static const char kGov2OriginalLexiconUsedForPruningFileName[] = "gov2_original_lexicon_used_for_pruning_file_name";

static const char kQueryTermProbablityDistributionFileName[] = "query_term_probablity_distribution_file_name";

static const char kQueryTermProbablityDistributionFileNameAdvanced[] = "query_term_probablity_distribution_file_name_advanced";

static const char kHistogramOutputFileName1[] = "histogram_output_file_name1";

static const char kHistogramOutputFileName2[] = "histogram_output_file_name2";

static const char kHistogramOutputFileName3[] = "histogram_output_file_name3";

static const char kHistogramOutputFileName4[] = "histogram_output_file_name4";

static const char kHistogramOutputFileName5[] = "histogram_output_file_name5";

static const char kHistogramOutputFileName6[] = "histogram_output_file_name6";

static const char kQueryTermsONLYInputfileName[] = "query_terms_ONLY_inputfile_name";

static const char kSmartQueryViewPostingScoresFileName[] = "smart_query_view_posting_scores_file_name";

static const char kThreeFeatureValuesForTrainingIn95KQueries[] = "three_feature_values_for_training_in_95KQueries";

static const char kQueryTermPredictionModelMethodValue[] = "query_term_prediction_model_method_value";

static const char kTermsWithTheirLengthOfInvertedIndexValue[] = "terms_with_their_length_of_inverted_index_value";

static const char kFirstProbabilityFactorFileName[] = "first_probability_factor_file_name";

static const char kFreqCorrespondingTermsFileName[] = "freq_corresponding_terms_file_name";

static const char kQueryLengthDistributionFileName[] = "query_length_distribution_file_name";

static const char kTrecIDWithXdocValuesFileName[] = "trecID_with_Xdoc_values_file_name";

static const char kPartialBM25ScoreRangesAndProbabilitiesFileName[] = "partialBM25_score_ranges_and_probabilities_file_name";

static const char kListLengthANDRelatativeRankAndProbabilitiesFileName[] = "list_length_and_relatative_rank_and_probabilities_file_name";

static const char kTail5KResultsWithRelatedPieceNumFileName[] = "tail_5K_results_with_related_piece_num_file_name";

static const char kTermsWithLengthOfListAndClassLabelAndNumOfPostingsInEachPiecesFileName[] = "terms_with_length_of_list_and_class_label_and_num_of_postings_in_each_pieces_file_name";

static const char kTermANDTermIDFileName[] = "term_AND_termID_file_name";

static const char kDocIDNumOfPostingsRecordedFileName[] = "docID_num_of_postings_recorded_file_name";

static const char kRandomlySelectedPostingListFileName[] = "randomly_selected_posting_list_file_name";

static const char kRandomlySelectedPostingListOutputFileName[] = "randomly_selected_posting_list_output_file_name";

static const char kTrecIDDocIDNumOfPostingsRecordedInIndexFileName[] = "trecID_docID_num_of_postings_recorded_in_index_file_name";

static const char kALLPostingsBeingPoppedAtDifferentLevelsFileName[] = "all_postings_being_popped_at_different_levels_file_name";

static const char kImportantPostingsBeingPoppedAtDifferentLevelsFileName[] = "important_postings_being_popped_at_different_levels_file_name";

static const char kRandomlySelectedPostingsWithTheirCorrespondingDocIDsFileName[] = "randomly_selected_postings_with_their_corresponding_docIDs_file_name";

} // namespace config_properties

#endif /* CONFIG_FILE_PROPERTIES_H_ */
